<script lang="ts" name="ConfigGlobal" setup>
import { propTypes } from "@/utils/propTypes";
import { setCssVar } from "@/utils";
import { ElementPlusSize } from "@/types/elementPlus";
import { useDesign } from "@/hooks/useDesign";
import { useWindowSize } from "@vueuse/core";

import zhCn from "element-plus/es/locale/lang/zh-cn";

const { variables } = useDesign();

const { width } = useWindowSize();

const props = defineProps({
  size: propTypes.oneOf<ElementPlusSize>(["default", "small", "large"]).def("default")
});
</script>

<template>
  <!-- Config Provider 全局配置,自定义命名空间等-->
  <ElConfigProvider :locale="zhCn" :namespace="variables.elNamespace" :size="size">
    <slot name="app"></slot>
  </ElConfigProvider>
</template>
